package org.mycub.server.dataprovider;

import java.util.List;

import org.mycub.server.data.models.PublicToilet;
import org.mycub.server.mongodb.MongoDB;

public class PublicToiletsProvider {

	/**
	 * @param args
	 */
	
	private List<PublicToilet> toilets;

	public List<PublicToilet> getPublicToilets(double longitude, double latitude, double rayon){
		
		List<PublicToilet> toilets = MongoDB.dataStore.find(PublicToilet.class).
				field("location").within(longitude,latitude,rayon).asList();
		
		return toilets;
	}

	public List<PublicToilet> getPublicToilets() {
		return toilets;
	}

	public void setPublicToilets(List<PublicToilet> toilets) {
		this.toilets = toilets;
	}

}
